﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
{-include file="`$__PHY_WEB``$__DIR_ADM`/block/meta.tpl"-}
<title>作品管理 - 后台</title>
</head>

<body>
<div class="sAll">

{-include file="`$__PHY_WEB``$__DIR_ADM`/block/header.tpl"-}
{-php-}include(__PHY_WEB.__DIR_ADM."/block/menu.php");{-/php-}
{-include file="`$__PHY_WEB``$__DIR_ADM`/block/menu.tpl" uL=$rNav-}

<div class="sL">
	<div class="sW main">
<!-- <main> -->
{- if $sMsg -}{- include file="`$__PHY_WEB``$__DIR_ADM`/block/message.tpl" -}{- /if -}

{- if 'list'==$sAction -}
<div class="tBox list">
	<!--
	<div><span>按类别查找：</span>
		<span><select onchange="location.href='?{-$rPager.Bse|build_query:"category:_"-}&category='+this.value;">
			<option value="0">&lt; 所有类别 &gt;</option>
{-section name=i loop=$rSlctCtgrys-}
	<option value="{-$rSlctCtgrys[i].id-}"{-if $rSlctCtgrys[i].id==$rP.category-} selected="selected"{-/if-}>{-$rSlctCtgrys[i].BreadCrumb|escape:html-}</option>
{-/section-}
		</select></span>
	</div>-->
	<table cellpadding="0" cellspacing="0">
		<tr class="capt">
			<td>ID</td>
			<td>类别</td>
			<td width="50">图片</td>
			<td>标题</td>
			<td width="180">副标题</td>
			<td>导演1</td>
			<td>导演2</td>
			<td width="60"><a href="?action=new">添加</a></td>
		</tr>
{-section name=i loop=$rList-}
		<tr>
			<td>{-$rList[i].id|escape:html-}</td>
			<td>{-$rList[i].category_id|uWork_category_title-}</td>
			<td>{-if $rList[i].thumb-}<a href="{-$rList[i]|@uWork_thumb:"225x112.jpg"-}">查看</a>{-/if-}</td>
			<td>{-$rList[i].title|escape:html-}</td>
			<td>{-$rList[i].title_sub|escape:html-}</td>
			<td>{-$rList[i].director_1_title|escape:html-}</td>
			<td>{-$rList[i].director_2_title|escape:html-}</td>
			<td><a href="?action=edit&id={-$rList[i].id-}">修改</a></td>
		</tr>
{-/section-}
	
	</table>
	<div>
		<span>翻页条：</span>
{-html_pager max=$rPager.Max page=$rPager.Num
	link="<a href=\"?`$rPager.Bse`&`$rPager.Req`={X}\">{X}</a>"
	text="{X}"
-}
		<span>每页{-$rPager.Sze-}条</span>
	</div>
</div>
{- elseif 'edit'==$sAction -}
<div class="sL edit">
	<p>修改</p>
	<form method="post" action="?" enctype="multipart/form-data">
	<table>
		<input type="hidden" name="id" value="{-$rOne.id|escape:html-}" />
		<tr>
			<td class="indc">类别：</td>
			<td><select name="category_id">
				<option value="1"{-if 1==$rOne.category_id-} selected="selected"{-/if-}>{-'1'|uWork_category_title-}</option>
				<option value="2"{-if 2==$rOne.category_id-} selected="selected"{-/if-}>{-'2'|uWork_category_title-}</option>
				<option value="3"{-if 3==$rOne.category_id-} selected="selected"{-/if-}>{-'3'|uWork_category_title-}</option>
				<option value="4"{-if 4==$rOne.category_id-} selected="selected"{-/if-}>{-'4'|uWork_category_title-}</option>
			</select></td>
		</tr>
		<tr>
			<td class="indc">标题：</td>
			<td><input type="text" name="title" value="{-$rOne.title|escape:html-}" class="long" /></td>
		</tr>
		<tr>
			<td class="indc">副标题：</td>
			<td><input type="text" name="title_sub" value="{-$rOne.title_sub|escape:html-}" class="long" /></td>
		</tr>
		<tr>
			<td class="indc">土豆IID：</td>
			<td><input type="text" name="tudou_link" value="{-$rOne.tudou_link|escape:html-}" class="long" /></td>
		</tr>
		<tr>
			<td class="indc">缩略图：</td>
			<td>{-if $rOne.thumb-}
				<img src="{-$rOne|@uWork_thumb:'225x112.jpg'-}" />
				<img src="{-$rOne|@uWork_thumb:'112x65.jpg'-}" />
				{-else-}<i>empty</i>{-/if-}
				<input type="file" name="file_thumb" />
			</td>
		</tr>
		<tr>
			<td class="indc">导演1：</td>
			<td><select name="director_1_id">
				<option value="0">&lt; 请选择 &gt;</option>
{-section name=i loop=$rSlctDirectors-}
				<option value="{-$rSlctDirectors[i].id-}"{-if $rSlctDirectors[i].id==$rOne.director_1_id-} selected="selected"{-/if-}>{-$rSlctDirectors[i].title|escape:html-}</option>
{-/section-}
			</select></td>
		</tr>
		<tr>
			<td class="indc">导演2：</td>
			<td><select name="director_2_id">
				<option value="0">&lt; 请选择 &gt;</option>
{-section name=i loop=$rSlctDirectors-}
				<option value="{-$rSlctDirectors[i].id-}"{-if $rSlctDirectors[i].id==$rOne.director_2_id-} selected="selected"{-/if-}>{-$rSlctDirectors[i].title|escape:html-}</option>
{-/section-}
			</select></td>
		</tr>
		<tr>
			<td class="indc">添加时间：</td>
			<td>{-$rOne.time_added|escape:html-}</td>
		</tr>
		<tr>
			<td class="indc">最后修改时间：</td>
			<td>{-$rOne.time_updated|escape:html-}</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<input type="submit" name="action" value="update" />
				<input type="submit" name="action" value="delete" onclick="return confirm('确定删除？');" />
				<input type="submit" name="action" value="cancel" />
			</td>
		</tr>
	</table>
	</form>
</div>
{- elseif 'new'==$sAction -}
<div class="sL edit">
	<p>修改</p>
	<form method="post" action="?" enctype="multipart/form-data">
	<table>
		<input type="hidden" name="id" value="{-$rOne.id|escape:html-}" />
		<tr>
			<td class="indc">类别：</td>
			<td><select name="category_id">
				<option value="1"{-if 1==$rOne.category_id-} selected="selected"{-/if-}>{-'1'|uWork_category_title-}</option>
				<option value="2"{-if 2==$rOne.category_id-} selected="selected"{-/if-}>{-'2'|uWork_category_title-}</option>
				<option value="3"{-if 3==$rOne.category_id-} selected="selected"{-/if-}>{-'3'|uWork_category_title-}</option>
				<option value="4"{-if 4==$rOne.category_id-} selected="selected"{-/if-}>{-'4'|uWork_category_title-}</option>
			</select></td>
		</tr>
		<tr>
			<td class="indc">标题：</td>
			<td><input type="text" name="title" value="{-$rOne.title|escape:html-}" class="long" /></td>
		</tr>
		<tr>
			<td class="indc">副标题：</td>
			<td><input type="text" name="title_sub" value="{-$rOne.title_sub|escape:html-}" class="long" /></td>
		</tr>
		<tr>
			<td class="indc">土豆IID：</td>
			<td><input type="text" name="tudou_link" value="{-$rOne.tudou_link|escape:html-}" class="long" /></td>
		</tr>
		<tr>
			<td class="indc">缩略图：</td>
			<td><input type="file" name="file_thumb" /></td>
		</tr>
		<tr>
			<td class="indc">导演1：</td>
			<td><select name="director_1_id">
				<option value="0">&lt; 请选择 &gt;</option>
{-section name=i loop=$rSlctDirectors-}
				<option value="{-$rSlctDirectors[i].id-}"{-if $rSlctDirectors[i].id==$rOne.director_1_id-} selected="selected"{-/if-}>{-$rSlctDirectors[i].title|escape:html-}</option>
{-/section-}
			</select></td>
		</tr>
		<tr>
			<td class="indc">导演2：</td>
			<td><select name="director_2_id">
				<option value="0">&lt; 请选择 &gt;</option>
{-section name=i loop=$rSlctDirectors-}
				<option value="{-$rSlctDirectors[i].id-}"{-if $rSlctDirectors[i].id==$rOne.director_2_id-} selected="selected"{-/if-}>{-$rSlctDirectors[i].title|escape:html-}</option>
{-/section-}
			</select></td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<input type="submit" name="action" value="add" />
				<input type="submit" name="action" value="cancel" />
			</td>
		</tr>
	</table>
	</form>
</div>
{- else -}
sth wrong: no $sAction.
{- /if -}

<!-- </main> -->
	</div>
</div>

{- include file="`$__PHY_WEB``$__DIR_ADM`/block/footer.tpl" -}

</div><!-- end all -->
</body>
</html>
